﻿
using System;
using System.Collections;
using System.Data;
using System.Globalization;

using OA.Manager;
using OA.Model;


namespace OA.Bll.Authority
{
    public class RolesPresenter : BasePresenter<RolesInfo>
    {
        private RolesManager _rolesManager;

        #region 授权

        /// <summary>
        /// 判断记录是否存在
        /// </summary>
        public bool RoleAuthorityExists(RoleAuthorityListInfo model)
        {
            _rolesManager = new RolesManager();
            return _rolesManager.RoleAuthorityExists(model);
        }

        /// <summary>
        /// 修改用户模块权限
        /// </summary>
        public bool UpdateUserAuthority(ArrayList list)
        {
            _rolesManager = new RolesManager();
            return _rolesManager.UpdateUserAuthority(list);
        }

        /// <summary>
        /// 读取用户的模块权限
        /// </summary>
        public DataSet GetUserAuthorityList(int userID, int moduleID)
        {
            _rolesManager = new RolesManager();
            return _rolesManager.GetUserAuthorityList(userID, moduleID);
        }

        /// <summary>
        /// 修改角色模块权限
        /// </summary>
        public bool UpdateRoleAuthority(ArrayList list)
        {
            _rolesManager = new RolesManager();
            return _rolesManager.UpdateRoleAuthority(list);
        }

        /// <summary>
        /// 读取角色的模块权限
        /// </summary>
        public DataSet GetRoleAuthorityList(int roleID, int moduleID)
        {
            _rolesManager = new RolesManager();
            return _rolesManager.GetRoleAuthorityList(roleID, moduleID);
        }

        /// <summary>
        /// 修改分组权限
        /// </summary>
        public bool UpdateGroupAuthority(ArrayList list)
        {
            _rolesManager = new RolesManager();
            return _rolesManager.UpdateGroupAuthority(list);
        }

        /// <summary>
        /// 读取分组权限
        /// </summary>
        public DataSet GetGroupAuthorityList(int groupID, int moduleID)
        {
            _rolesManager = new RolesManager();
            return _rolesManager.GetGroupAuthorityList(groupID, moduleID);
        }
        public DataSet GetRoleList(string strWhere, string strOrder)
        {
            _rolesManager = new RolesManager();
            return _rolesManager.GetRoleList(strWhere, strOrder);
        }
        #endregion
    }
}
